import request from '@/utils/request'

/** 判断店铺授权 */
export function getShopAuth(query) {
    return request({
        url: '/auth/shopAuth',
        method: 'get',
        params: query
    })
}

/** 查询所有店铺授权记录 */
export function getList() {
    return request({
        url: '/auth/list',
        method: 'get',
    })
}

/** 删除店铺授权记录 */
export function delShopAuth(authId) {
    return request({
        url: '/auth/' + authId,
        method: 'delete',
    })
}

/** 重新授权店铺 */
export function updateShopAuth(data) {
    return request({
        url: '/auth',
        method: 'put',
        data: data
    })
}

/** 授权店铺详情页 */
export function getInfo(authId) {
    return request({
        url: '/auth/' + authId,
        method: 'get',
    })
}

/** 查询店铺分类 */
export function getPlatFormTree() {
    return request({
        url: '/auth/platFormTree',
        method: 'get',
    })
}

/** 查询站点分类 */
export function getSiteFormTree() {
    return request({
        url: '/auth/siteFormTree',
        method: 'get',
    })
}

/** 查询品牌 */
export function getSelectAuthBrand(query) {
    return request({
        url: '/auth/selectAuthBrand',
        method: 'get',
        params: query
    })
}

/** 添加品牌 */
export function getAuthBrandInsert(data) {
    return request({
        url: '/auth/authBrandInsert',
        method: 'post',
        data: data
    })
}

/** 品牌详情页 */
export function getSelectByAuthBrandId(authBrandId) {
    return request({
        url: '/auth/selectByAuthBrandId/' + authBrandId,
        method: 'get',
    })
}
// 修改品牌
export function getUpdateAuthBrand(data) {
    return request({
        url: '/auth/updateAuthBrand',
        method: 'put',
        data: data
    })
}

// 删除品牌
export function getUpdateByAuthBrandId(authBrandId) {
    return request({
        url: '/auth/updateByAuthBrandId/' + authBrandId,
        method: 'delete'
    })
}

// 递归品牌
export function getAuthBrandTree(query) {
    return request({
        url: '/auth/authBrandTree',
        method: 'get',
        params: query
    })
}